package gui;

import guiDisplay.MovieComment;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.WindowConstants;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class pnlUserComment extends javax.swing.JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JLabel jLabel2;
	private JLabel jLabel3;
	private JLabel jLabel4;
	private JScrollPane jScrollPane1;
	private JTextPane txtDescription;
	private JLabel lblDate;
	private JLabel jLabel6;
	private JLabel lblRating;
	private JLabel lblName;

	/**
	* Auto-generated main method to display this 
	* JPanel inside a new JFrame.
	*/
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.getContentPane().add(new pnlUserComment(new MovieComment("userNameHere" , "5/10" , "5/10/2008" , "I raelly liked the movie , and it was very interesting , I really hoped it would last forever")));
		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		frame.pack();
		frame.setVisible(true);
	}
	
	public pnlUserComment(MovieComment comment) {
		super();
		initGUI(comment);
	}
	
	private void initGUI(MovieComment comment) {
		try {
			this.setPreferredSize(new java.awt.Dimension(431, 119));
			this.setSize(431, 119);
			this.setLayout(null);
			this.setBackground(new java.awt.Color(255,128,0));
			{
				jLabel2 = new JLabel();
				this.add(jLabel2);
				jLabel2.setText("Rating:");
				jLabel2.setBounds(161, 8, 42, 17);
			}
			{
				jLabel3 = new JLabel();
				this.add(jLabel3);
				jLabel3.setText("Date:");
				jLabel3.setBounds(290, 6, 35, 20);
			}
			{
				jLabel4 = new JLabel();
				this.add(jLabel4);
				jLabel4.setText("User:");
				jLabel4.setBounds(15, 7, 38, 19);
			}
			{
				lblName = new JLabel();
				this.add(lblName);
				lblName.setText(comment.getUser());
				lblName.setBounds(48, 9, 112, 14);
			}
			{
				lblRating = new JLabel();
				this.add(lblRating);
				lblRating.setText(comment.getRating());
				lblRating.setBounds(206, 9, 76, 14);
			}
			{
				lblDate = new JLabel();
				this.add(lblDate);
				lblDate.setText(comment.getDate());
				lblDate.setBounds(328, 8, 81, 17);
			}
			{
				jLabel6 = new JLabel();
				this.add(jLabel6);
				jLabel6.setText("Description:");
				jLabel6.setBounds(10, 36, 80, 14);
			}
			{
				jScrollPane1 = new JScrollPane();
				this.add(jScrollPane1);
				jScrollPane1.setBounds(83, 36, 331, 72);
				jScrollPane1.setBackground(new java.awt.Color(255,128,0));
				{
					txtDescription = new JTextPane();
					jScrollPane1.setViewportView(txtDescription);
					txtDescription.setText(comment.getDescription());
					txtDescription.setBounds(77, 37, 331, 102);
					txtDescription.setPreferredSize(new java.awt.Dimension(328, 67));
					txtDescription.setBackground(new java.awt.Color(255,128,0));
					txtDescription.setEditable(false);
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
